import React,{useState} from 'react'

function Mystate() {
    // 变量和set+变量
    // 有新顺序,不允许多状态声明
    const [ count,setCount  ] = useState(0)
    const [ age,setAge  ] = useState(18)
    const [ name,setName  ] = useState('张三')
    const add = (params) => {
        setCount(count+1)
    }
    
    return (
        <div>
           <button onClick={add}> 点击添加{count} </button> 
           {name}----{age}
        </div>
    )
}

export default Mystate
